﻿<link rel="stylesheet" href="/static/lib/layui/css/layui.css" />
<link rel="stylesheet" href="/static/md/css/editormd.preview.css" />
<link rel="stylesheet" href="/static/default/css/blog-common.min.css" />
<link id="MainCss" rel="stylesheet" href="/static/default/css/bundle-codinglife.min.css" />

{{template "home/default/header.html" .}}
<style>
    blockquote{
        border:none;
    }
</style>
<div id="main">
    <div class="container main-container">
        <div class="row">
            <div class="col-md-3">
                <div class="box">
                    <div id="category-menu" class="cell slim page-box" style="padding-top: 20px;">
                        <ul>
                            {{range $key ,$vlaue := $.List}}
                                <li>
                                    <a href="javascript:;">{{$key}}</a>
                                    <ul style="padding-left: 20px">
                                        {{range $k ,$v := $vlaue}}
                                        <li>
                                            <a {{if eq $v.Id $.ArticleId}}style="color: #f04c5c" {{end}} title="{{$v.Title}}" href="/detail/{{$v.Id}}.html">{{$v.Title}}</a>
                                        </li>
                                        {{end}}
                                    </ul>
                                </li>
                            {{end}}
                        </ul>
                    </div>
                </div>
            </div>
            <div class="col-md-9">

                <div class="box">
                    <div id="markdown" class="cell slim page-box markdown-body editormd-html-preview" style="padding-top: 20px">
                        {{str2html $.Data.Html}}
                    </div>
                    {{template "home/default/review.html" .}}
                </div>

            </div>
        </div>
    </div>
</div>
{{template "home/default/footer.html" .}}

<script src="/static/md/lib/marked.min.js"></script>
<script src="/static/md/lib/prettify.min.js"></script>

<script src="/static/md/lib/raphael.min.js"></script>
<script src="/static/md/lib/underscore.min.js"></script>
<script src="/static/md/lib/sequence-diagram.min.js"></script>
<script src="/static/md/lib/flowchart.min.js"></script>
<script src="/static/md/lib/jquery.flowchart.min.js"></script>

<script src="/static/md/editormd.js"></script>
{{/*<script type="text/javascript">
    $(function() {
        var testEditormdView2;

        testEditormdView2 = editormd.markdownToHTML("markdown", {
            markdown        : {{str2html $.Data.Desc}},
            htmlDecode      : "style,script,iframe",  // you can filter tags decode
            emoji           : true,
            taskList        : true,
            tex             : true,  // 默认不解析
            flowChart       : true,  // 默认不解析
            sequenceDiagram : true,  // 默认不解析
        });
    });
</script>*/}}
<script src="/static/js/jquery-2.2.0.min.js"></script>
<script>
    $(function () {
        $.ajax({
            url:'/pv/{{$.Data.Id}}.html',
            type:'get',
            success:function (data) {
                console.log(data);
            }
        });

        $(".like a").click(function () {
            $.ajax({
                url:'/article/like',
                type:'post',
                data:{"id":{{$.Data.Id}}},
                success:function (data) {
                    if(data.code == 200) {
                        $(".like span").html("(" + data.like + ")")
                    }
                }
            });
        })
    })

</script>